<template>
	<view>
		<view style="height: 20rpx"></view>
		<view @tap="toDetail(item.userId)" class="item flex-row" v-for="item in list" :key="item.userId">
			<xbc-avatar :src="item.avatar" size="40px" />
			<view class="title">{{ item.name }}</view>
		</view>
		<view style="height: 20rpx"></view>
	</view>
</template>

<script>
import XBCIM from 'xbcim'
export default{
	data(){
		return {
			list: []
		}
	},
	onLoad(){
		this.getList()
	},
	methods: {
		toDetail(userId) {
			uni.navigateTo({
				url: `/pages/contact/detail?userId=${userId}`
			})
		},
		async getList() {
			this.list = await XBCIM.getBlackList()
		}
	}
}
</script>

<style lang="scss" scoped>
.item {
	padding: 20rpx 30rpx;

	.title {
		flex: 1;
		color: #333;
		font-size: 30rpx;
		margin-left: 30rpx;
		@include line-height(80rpx);
	}
}
</style>